﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Bilylib;

public partial class Company : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            BindService();
        }
    }

    private void BindService()
    {
        if (Session["Company"] != null)
        {
            rptBusinness.DataSource = (DataTable)(Session["Company"]);
            rptBusinness.DataBind();
        }
        else
        {
            DataTable tbBusinness = new DataTable();
            string sql = "Select * From Service Where CateID = @CateID Order By ServiceID Desc";
            Select select = Select.newInstance();
            select.SetConnectionName("HoangThinhDataConnectionString");
            select.SetValues(8);
            tbBusinness = select.SelectCustomParam(sql);
            Session["Company"] = tbBusinness;
            rptBusinness.DataSource = tbBusinness;
            rptBusinness.DataBind();
        }
    }
}